package com.itg.vms.service.impl;

import com.itg.vms.dao.MoviesDao;
import com.itg.vms.dao.impl.MoviesDaoImpl;
import com.itg.vms.entity.Movies;
import com.itg.vms.service.MoviesService;

import java.util.List;

public class MoviesServiceImpl implements MoviesService {
    //创建dao层
    MoviesDao moviesDao=new MoviesDaoImpl();
    //添加视频信息
    @Override
    public boolean addMovies(Movies movies) {
        return moviesDao.addMovies(movies);
    }
    /**
     * 删除视频信息
     */
    @Override
    public int deleteMoviesById(String movie_Id) {
        return moviesDao.deleteMoviesById(movie_Id);
    }
    //修改视频信息
    @Override
    public boolean UpdateMoviesById(String movie_Picture, String movie_ChineseName, String movie_Name,
                                    String movie_Age, String movie_Place, String movie_Type, String movie_Language,
                                    String movie_Subtitle, String movie_ReleaseDate, String IMDbScore, String DBScore,
                                    String movie_Times, String movie_Director, String movie_Scriptwriter, String movie_Actor,
                                    String movie_Introduction,String movie_Link,Integer movie_Id) {
        return moviesDao.UpdateMoviesById(movie_Picture,movie_ChineseName, movie_Name, movie_Age,
                 movie_Place, movie_Type, movie_Language, movie_Subtitle, movie_ReleaseDate, IMDbScore, DBScore,
                movie_Times, movie_Director, movie_Scriptwriter, movie_Actor, movie_Introduction,movie_Link,movie_Id);
    }

    @Override
    public List<Movies> selectMoviesByName(String movie_Name) {
        return moviesDao.selectMoviesByName(movie_Name);
    }

    //显示视频信息
    @Override
    public Movies DisplayMoviesById(String movie_id) {
        return moviesDao.DisplayMoviesById(movie_id);
    }

    /**
     * 分页展示所有视频信息
     */
    @Override
    public List<Movies> selectAllMovies(Integer currentPage, Integer pageSize) {
        return moviesDao.selectAllMovies(currentPage,pageSize);
    }
    /**
     * movies的总记录数
     */
    @Override
    public Long getAllMoviesSize() {
        return moviesDao.getAllMoviesSize();
    }

    /**
     * 根据电影id查询电影的详细信息
     *
     * @param id
     * @author zjzaki
     * @return 电影详细信息实体
     */
    @Override
    public Movies getMovieDetailById(Integer id) {
        return moviesDao.getMovieById(id);
    }

}
